package com.jeeinc.oa.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeinc.oa.dao.IAccountDao;
import com.jeeinc.oa.domain.Account;
import com.jeeinc.oa.service.IAccountService;

@Service
@Transactional
public class AccountServiceImpl implements IAccountService {
	@Resource
	private IAccountDao accountDao;

	@Override
	public Account getAccount(Integer id) {
		return accountDao.get(id);
	}

	@Override
	public Account getAccount(String loginname) {
		return accountDao.unique("loginname", loginname);
	}

	@Override
	public void saveAccount(Account account) {
		accountDao.save(account);
	}

	@Override
	public void updateAccount(Account account) {
		accountDao.update(account);
	}

}
